﻿<Window x:Class="iPlayMVVM.FullScreen"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cp="clr-namespace:DropDownCustomColorPicker;assembly=CustomColorPicker"
        Title="iPlay"
        xmlns:local="clr-namespace:iPlayMVVM;assembly=" 
        Background="Gray"
        xmlns:viewmodel="clr-namespace:iPlayMVVM.ViewModel;assembly=" ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterOwner" WindowState="Maximized">
    <Window.Resources>
        <local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <local:BooleanToStringConverter x:Key="BooleanToStringConverter"/>
        <local:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/>
        <local:CommaStringToListConverter x:Key="CommaStringToListConverter"/>
        <local:ListToCountConverter x:Key="ListToCountConverter"/>
        <local:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
        <local:TextToVisibilityConverter x:Key="TextToVisibilityConverter"/>
        <local:BlacklistValidator x:Key="BlacklistValidator"/>
        <local:NonZeroToVisibilityConverter x:Key="NonZeroToVisibilityConverter"/>
        <local:BooleanToPlayStateConverter x:Key="BooleanToPlayStateConverter"/>
        <viewmodel:iTunesViewModel x:Key="iTunesViewModel"/>
    </Window.Resources>
    <Window.DataContext>
        <viewmodel:iTunesViewModel/>
    </Window.DataContext>
    <Window.InputBindings>
        <KeyBinding Command="{Binding PlayPause}" Gesture="SPACE"/>
        <KeyBinding Command="{Binding ForwardTrack}" Gesture="RIGHT"/>
        <KeyBinding Command="{Binding BackTrack}" Gesture="LEFT"/>
    </Window.InputBindings>
    <Grid>
        <Grid HorizontalAlignment="Right">
            <Grid.RowDefinitions>
                <RowDefinition Height="5*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Image Source="{Binding Path=ArtworkPath}" Name="ArtworkImg">
                <!--<Image.OpacityMask>
                <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                    <GradientStop Offset="0.0" Color="Transparent"/>
                    <GradientStop Offset="1.0" Color="#F0000000"/>
                </LinearGradientBrush>
            </Image.OpacityMask>-->
            </Image>
            <Rectangle Grid.Row="1" RenderTransformOrigin="0.5,0.5" Width="{Binding ElementName=ArtworkImg, Path=ActualWidth}">
                <Rectangle.Fill>
                    <VisualBrush Visual="{Binding ElementName=ArtworkImg}"/>
                </Rectangle.Fill>
                <Rectangle.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleY="-1"/>
                        <SkewTransform AngleX="-20"/>
                        <TranslateTransform X="-27"/>
                    </TransformGroup>
                </Rectangle.RenderTransform>
                <Rectangle.OpacityMask>
                    <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                        <GradientStop Offset="0.0" Color="#00000000" />
                        <GradientStop Offset="1.0" Color="#FF000000" />
                    </LinearGradientBrush>
                </Rectangle.OpacityMask>
            </Rectangle>
        </Grid>
        <Grid HorizontalAlignment="Left">
            <StackPanel>
                <Label FontFamily="Eras ITC" FontSize="40"  Content="{Binding Path=CurrentSong.Name}" FontStyle="Italic" HorizontalAlignment="Left" Width="Auto" MaxWidth="Infinity" />
                <Label Content="{Binding Path=CurrentSong.Artist}" FontFamily="Eras ITC" FontSize="40" HorizontalAlignment="Left" Width="Auto"  FontWeight="Normal" FontStyle="Normal" FontStretch="ExtraExpanded" />
            </StackPanel>
        </Grid>
        <Button Content="Close" Background="Transparent" IsCancel="True" Height="20" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" Width="60" />
        <StackPanel Margin="0,0,0,50" VerticalAlignment="Bottom">
            <DockPanel HorizontalAlignment="Center" Name="Controls">
                <Button Content="&lt;&lt;" Background="Gray" FontWeight="ExtraBold" Height="20" VerticalAlignment="Bottom" Margin="2,10" Width="25" Command="{Binding BackTrack}"/>
                <Button Content="{Binding Path=PlayState, Converter={StaticResource BooleanToPlayStateConverter}}" Background="Gray" Height="30" FontWeight="ExtraBold" VerticalAlignment="Bottom" Margin="2,10" Width="30" Command="{Binding PlayPause}"/>
                <Button Content="&gt;&gt;" Background="Gray" Height="20" FontWeight="ExtraBold" VerticalAlignment="Bottom" Margin="2,10" Width="25" Command="{Binding ForwardTrack}"/>
            </DockPanel>
            <cp:CustomColorPicker Width="40" x:Name="customCP" VerticalAlignment="Center" Margin="5,0"/>
            <Button Content="iTunes" Background="Gray" Width="{Binding ElementName=Controls, Path=ActualWidth}" />
        </StackPanel>
    </Grid>
</Window>
